home *** CD-ROM | disk | FTP | other *** search
Text File | 2000-10-06 | 3.8 KB | 149 lines | [TEXT/CWIE] |
- ///--------------------------------------------------------------------------------------
- // SpriteLayer.h
- //
- // Portions are copyright: © 1991-94 Tony Myles, All rights reserved worldwide.
- //
- // Description: constants, structures, and prototypes for sprite layers
- ///--------------------------------------------------------------------------------------
-
-
- #ifndef __SPRITELAYER__
- #define __SPRITELAYER__
-
-
- #ifndef __SWCOMMON__
- #include <SWCommonHeaders.h>
- #endif
-
- #ifndef __SPRITE__
- #include <Sprite.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
-
- // The following macros make the code in SWCollideSpriteLayer slightly easier to read.
- #define SW_COLLISION_RECT_TOP(spriteP) \
- (spriteP->destFrameRect.top + spriteP->curFrameP->collisionInset.top)
-
- #define SW_COLLISION_RECT_LEFT(spriteP) \
- (spriteP->destFrameRect.left + spriteP->curFrameP->collisionInset.left)
-
- #define SW_COLLISION_RECT_BOTTOM(spriteP) \
- (spriteP->destFrameRect.bottom - spriteP->curFrameP->collisionInset.bottom)
-
- #define SW_COLLISION_RECT_RIGHT(spriteP) \
- (spriteP->destFrameRect.right - spriteP->curFrameP->collisionInset.right)
-
-
- ///--------------------------------------------------------------------------------------
- // sprite layer data structure
- ///--------------------------------------------------------------------------------------
-
- struct SpriteLayerRec
- {
- SpriteLayerPtr nextSpriteLayerP; // next sprite layer
- SpriteLayerPtr prevSpriteLayerP; // previous sprite layer
-
- SpritePtr headSpriteP; // head of sprite linked list
- SpritePtr tailSpriteP; // tail of sprite linked list
-
- long userData; // reserved for user
- short tileLayer; // the tile layer this sprite layer is under
- Boolean isPaused; // does this layer get processed by SWProcessSpriteWorld?
- Boolean layerIsNonScrolling; // is this a non-scrolling SpriteLayer?
- };
-
-
- ///--------------------------------------------------------------------------------------
- // sprite layer function prototypes
- ///--------------------------------------------------------------------------------------
-
- SW_FUNC OSErr SWCreateSpriteLayer(
- SpriteLayerPtr *spriteLayerP);
-
- SW_FUNC void SWDisposeSpriteLayer(
- SpriteLayerPtr *spriteLayerPP);
-
- SW_FUNC OSErr SWAddSprite(
- SpriteLayerPtr spriteLayerP,
- SpritePtr newSpriteP);
-
- SW_FUNC OSErr SWRemoveSprite(
- SpritePtr oldSpriteP);
-
- SW_FUNC void SWRemoveAllSpritesFromLayer(
- SpriteLayerPtr srcSpriteLayerP);
-
- SW_FUNC void SWDisposeAllSpritesInLayer(
- SpriteLayerPtr spriteLayerP);
-
- SW_FUNC short SWCountNumSpritesInLayer(
- SpriteLayerPtr spriteLayerP);
-
- SW_FUNC OSErr SWSwapSprite(
- SpritePtr srcSpriteP,
- SpritePtr dstSpriteP);
-
- SW_FUNC OSErr SWInsertSpriteAfterSprite(
- SpritePtr newSpriteP,
- SpritePtr dstSpriteP);
-
- SW_FUNC OSErr SWInsertSpriteBeforeSprite(
- SpritePtr newSpriteP,
- SpritePtr dstSpriteP);
-
- SW_FUNC SpritePtr SWGetNextSprite(
- SpriteLayerPtr spriteLayerP,
- SpritePtr curSpriteP);
-
- SW_FUNC SpritePtr SWGetPreviousSprite(
- SpriteLayerPtr spriteLayerP,
- SpritePtr curSpriteP);
-
- SW_FUNC void SWLockSpriteLayer(
- SpriteLayerPtr spriteLayerP);
-
- SW_FUNC void SWUnlockSpriteLayer(
- SpriteLayerPtr spriteLayerP);
-
- SW_FUNC void SWMoveSpriteLayer(
- SpriteLayerPtr spriteLayerP);
-
- SW_FUNC void SWCollideSpriteLayer(
- SpriteWorldPtr spriteWorldP,
- SpriteLayerPtr srcSpriteLayerP,
- SpriteLayerPtr dstSpriteLayerP);
-
- SW_FUNC void SWSortSpriteLayer(SpriteLayerPtr theLayer);
-
- SW_FUNC void SWPauseSpriteLayer(
- SpriteLayerPtr spriteLayerP);
-
- SW_FUNC void SWUnpauseSpriteLayer(
- SpriteLayerPtr spriteLayerP);
-
- SW_FUNC void SWSetLayerAsNonScrolling(
- SpriteLayerPtr spriteLayerP,
- Boolean layerIsNonScrolling);
-
- SW_FUNC SpritePtr SWFindSpriteByPoint(
- SpriteLayerPtr spriteLayerP,
- SpritePtr startSpriteP,
- Point testPoint);
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __SPRITELAYER__ */